package controller;

import java.awt.Point;

/**
 * Interface used to check for hazards in game. Hazards are unsafe moves, Check or Checkmate
 */
public interface Hazards {

	/**
	 * Checks if opponent pieces have a path that reaches currently attacked King.
	 * If there is at least one path, King is threatened and check is declared.
	 * @param isFirstPlayerTurn- indicates currently playing player  
	 * @return True if attacked King is threatened, False if not
	 */	
	public boolean isCheck(boolean isFirstPlayerTurn);
	
	/**
	 * Gets move's details and checks if given move results in the friendly King
	 * being threatened. If making a move threats the friendly King, the move is not safe
	 * @param srcPosition- source position
	 * @param destPosition- destination position
	 * @param isFirstPlayerTurn- indicates currently playing player
	 * @return True if move is not safe, False if move is safe
	 */
	public boolean moveNotSafe(Point srcPosition, Point destPosition, boolean isFirstPlayerTurn);
	
	/**
	 * Checks if the attacked King has an escape path or if a friendly piece
	 * can block the attack.
	 * If so, a move can be done. Otherwise, not
	 * @param isFirstPlayerTurn- indicates currently playing player
	 * @return True if attacked player cannot move, False if not
	 */
//	public boolean cannotMove(boolean isFirstPlayerTurn);
	
	/**
	 * Declares Stalemate if game is not in check and no safe move can be done by the attacked player.
	 * Returns True if Stalemate is declared, False if not
	 * @param isFirstPlayerTurn- indicates currently playing player
	 * @return True if Stalemate, False if not
	 */
	public boolean isStalemate(boolean isFirstPlayerTurn);
	
	/**
	 * Declares Checkmate if game is in Check and no safe move can be done.
	 * Returns True if Checkmate is declared, False if not	 * 
	 * @param isFirstPlayerTurn- indicates currently playing player
	 * @return True if Checkmate, False if not
	 */
	public boolean isCheckmate(boolean isFirstPlayerTurn);
}